![New Socket Web Extension, Take Socket with You](https://cdn.sanity.io/images/cgdhsj6q/production/7c7e90f37af51d175eaf8b2ae56124aec35c57c8-874x566.png?w=400&fit=max&auto=format)
Product
New Socket Web Extension, Take Socket with You
Can you spot malicious malicious packages on the web at a glance? Socket can. Check out our updated Web Extension!
@pixi/constants
Advanced tools
Package description
@pixi/constants is a package that provides a set of constants used throughout the PixiJS library. These constants are essential for defining various properties and behaviors in the rendering process, such as blend modes, draw modes, and texture formats.
Blend Modes
Blend modes are used to determine how colors are combined when drawing one object over another. The @pixi/constants package provides predefined blend modes like ADD, MULTIPLY, and SCREEN.
const { BLEND_MODES } = require('@pixi/constants');
console.log(BLEND_MODES.ADD); // Output: 1
Draw Modes
Draw modes define how vertices are interpreted when rendering shapes. The package includes constants for different draw modes such as POINTS, LINES, and TRIANGLES.
const { DRAW_MODES } = require('@pixi/constants');
console.log(DRAW_MODES.TRIANGLES); // Output: 4
Texture Formats
Texture formats specify the format of the pixel data in textures. The @pixi/constants package provides constants for various formats like RGBA, RGB, and ALPHA.
const { FORMATS } = require('@pixi/constants');
console.log(FORMATS.RGBA); // Output: 6408
Three.js is a popular 3D library that also provides a set of constants for various rendering properties. It includes constants for blend modes, draw modes, and texture formats, similar to @pixi/constants, but is more focused on 3D rendering.
Phaser is a 2D game framework that includes its own set of constants for game development. While it provides similar functionalities like blend modes and texture formats, it is more geared towards game development rather than general rendering.
Readme
npm install @pixi/constants
import * as constants from '@pixi/constants';
FAQs
Constants used across PixiJS
We found that @pixi/constants demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Can you spot malicious malicious packages on the web at a glance? Socket can. Check out our updated Web Extension!
Product
Socket introduces three new customizable default security policies for users to choose from: Low Noise (traditional SCA), Default, and Higher Noise.
Security News
MITRE has just minted its 400th CNA, as the NVD struggles to tame its backlog of CVEs awaiting analysis, which has increased by 30% since June.